$(document).ready(function() { 
 
	var leftpos = '0';
	var rightpos = '0';
	
	
	$('.header').mouseover(function (e) {
	    e.preventDefault();
		$(this).css({backgroundPosition: '0px -15px'});
    });
	
	$('.header').mouseout(function (e) {
	    e.preventDefault();
		$(this).css({backgroundPosition: '0px 0px'});
    }); 
	
	$('.social').mouseover(function (e) {
	    e.preventDefault();
		$(this).css({backgroundPosition: '0px 0px'});
    });
	
	$('.social').mouseout(function (e) {
	    e.preventDefault();
		$(this).css({backgroundPosition: '0px 20px'});
    }); 
	
	//SOCIAL SPRITE
    $('a[name=social_left]').click(function (e) {
	    e.preventDefault();
		if(parseInt(leftpos) > 0)
		{
			leftpos = parseInt(leftpos) - 100;
		}
		updateSprite(leftpos, rightpos);
    }); 
	
	//SOCIAL SPRITE
    $('a[name=social_right]').click(function (e) {
		e.preventDefault();
		if(parseInt(leftpos) < 300)
		{
			leftpos = parseInt(leftpos) + 100;
		}
		updateSprite(leftpos, rightpos);
    }); 
	
	//SOCIAL SPRITE
    $('a[name=social_up]').click(function (e) {
		e.preventDefault();
		if(parseInt(rightpos) > 0)
		{
			rightpos = parseInt(rightpos) - 100;
		}
		updateSprite(leftpos, rightpos);
    }); 
   //SOCIAL SPRITE
    $('a[name=social_down]').click(function (e) {
		e.preventDefault();
		if(parseInt(rightpos) < 200)
		{
			rightpos = parseInt(rightpos) + 100;
		}
		updateSprite(leftpos, rightpos);
    });
	
	function updateSprite(leftpos, rightpos){
		$('.meey_sprite').css({backgroundPosition: '-' + leftpos + 'px' + ' -' + rightpos + 'px'}); 
	}
   
});